package com.gulimall.ware.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.gulimall.common.to.SkuHasStockVo;
import com.gulimall.common.utils.PageUtils;
import com.gulimall.ware.entity.WareSkuEntity;

import java.lang.reflect.InvocationTargetException;
import java.util.List;
import java.util.Map;

/**
 * 商品库存
 *
 * @author mxl
 * @email 3299686223@qq.com
 * @date 2022-08-08 15:54:01
 */
public interface WareSkuService extends IService<WareSkuEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 添加库存
     *
     * @param skuId  商品id
     * @param wareId 仓库 id
     * @param skuNum 数量
     */
    void addStock(Long skuId, Long wareId, Integer skuNum) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException;

    /**
     * 判断是否有库存
     *
     * @param skuIds
     * @return
     */
    List<SkuHasStockVo> getSkuHasStock(List<Long> skuIds);
}

